<template>
  <div class="card-item">
    <div class="card-item-header">
      <div>{{ title }}</div>
      <div>{{ subTitle }}</div>
    </div>
    <div class="card-item-main">{{ content }}</div>
  </div>
</template>

<script setup lang="ts">
type Props = {
  title: string
  subTitle?: string
  content?: string
}
withDefaults(defineProps<Props>(), {
  title: '主标题',
  subTitle: '副标题',
  content: '我是内容区'
})


</script>

<style lang="less" scoped>
@border: #ccc;
.card-item {
  border: 1px solid @border;
  margin-bottom: 10px;
  &:last-child {
    margin-bottom: 0px;
  }
  &:hover {
    box-shadow: 0 0 6px #ccc;
  }
  &-header {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid @border;
  }
  &-main {
    padding: 8px;
  }
}
</style>